﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace YY.Web.MyAgent.Register
{
    /// <summary>
    /// GetAreaData 的摘要说明
    /// </summary>
    public class GetAreaData : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int ParentID = BaseFunction.StringHelp.IsNumberAndNotnull(context.Request.QueryString["ID"] + "", 0);
            YY.BLL.Common_Area bll_Common_Area = new BLL.Common_Area();
            DataSet ds = bll_Common_Area.GetList("parentId=" + ParentID + " ORDER BY ssqId ASC");
            string JSON = BaseFunction.EasyUIHelp.DataTable2EasyUiTreeGridJson(ds.Tables[0], "ssqId", "parentId", ParentID);
            JSON = JSON.Replace("ssqId", "id").Replace("ssqName", "text");
            context.Response.Write(JSON);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}